/*
 * @Author: 陈朝朝60258 zhaozhao.chen@going-link.com
 * @Date: 2023-10-25 00:01:44
 * @LastEditors: 陈朝朝60258 zhaozhao.chen@going-link.com
 * @LastEditTime: 2024-02-29 18:31:50
 * @FilePath: /next-app/app/productadd/page.tsx
 * @Description: 更新产品
 */
import React from "react";
import ProductForm from "../../compoents/ProductForm";
import { PageProps } from "@/.next/types/app/layout";
import { ProductProps } from "../../product/[id]/page";
const EditProduct = async ({ params }: PageProps) => {
  const { id } = params;
  const data = await fetch(`${process.env.API_HOST}/api/product/${id}`, {
    method: "get",
    cache: "no-cache",
  });

  const product: ProductProps = await data.json();
  return <ProductForm method="put" content={product} />;
};
export default EditProduct;
